/**
 * User: ct/512799311@qq.com
 * Date: 2017/11/10 0010
 * Time: 上午 10:45
 *
 */

import jsonp from 'common/js/jsonp.js'
import {commonParams,options} from 'api/config.js'
import axios from 'axios'

export function getRecommend() {
    const url = 'https://c.y.qq.com/musichall/fcgi-bin/fcg_yqqhomepagerecommend.fcg';
    const data=Object.assign({},commonParams,{
        platfrm:'h5',
        uin:0,
        needNewCode:1
    });
    //https://c.y.qq.com/musichall/fcgi-bin/fcg_yqqhomepagerecommend.fcg
    //https://c.y.qq.com/splcloud/fcgi-bin/p.fcg?g_tk=231506344&format=jsonp&jsonpCallback=jsonp1
    return jsonp(url,data,options)
}

export function getDiscList() {
    const url = "api/gitDiscList";

    const data = Object.assign({}, commonParams, {
        platform: 'yqq',
        picmid:1,
        hostUin:0,
        loginUin:0,
        sin:0,
        ein:29,
        sortId:5,
        needNewCode:0,
        categoryId:10000000,
        rnd:Math.random(),
        format:'json'

    });

    return axios.get(url,{
        params:data
    }).then((res)=>{
        //console.log(res);
        return Promise.resolve(res.data)
    });
}